package com.nanhu.test.media;

import com.nanhu.test.R;
import android.app.Activity;
import android.media.AudioManager;
import android.media.SoundPool;
import android.os.Bundle;
import android.view.View;

public class SoundPoolTestActivity extends Activity{
	
	private SoundPool pool;
	
	private int sourceId;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.soundpull_layout);
		
		pool = new SoundPool(10, AudioManager.STREAM_ALARM, 5);
		sourceId = pool.load(this, R.raw.sword, 0);
	}
	
	public void play(View view){
		pool.play(sourceId, 1, 1, 0, 1, 1);
	}
}
